﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CreateMotion.aspx.cs" Inherits="OUSMS.CreateMotion" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="topchannel">
        新建提案	 
    </div>
    <table border="0" cellspacing="1" cellpadding="2">
        <tr class="row2">
            <td style="color:red" align="left"><b>提示：</b>[提示信息，待完善]点击“保存”保存提案信息，但不会提交审核，你可以到我的提案列表修改确认之后提交。点击“提交”提案将会进入审核流程，在审核过程中将不能再进行修改。</td>
        </tr>      
    </table>
    <ajaxToolkit:TabContainer ID="TabContainer" runat="server" Width="100%"
        AutoPostBack="false" TabStripPlacement="Top">
        <ajaxToolkit:TabPanel runat="server" ID="basicTab" HeaderText="基本信息">
            <ContentTemplate>
                <table border="0" cellspacing="1" cellpadding="2" style="width: 100%; color: darkgray">
                    <tr class="row2">
                        <td><b>标题</b></td>
                        <td colspan="4">
                            <asp:TextBox ID="titleTxtBox" runat="server" Height="20px" Width="100%"></asp:TextBox><asp:RequiredFieldValidator ID="titleRequiredFieldValidator"
                                runat="server" ErrorMessage="必须输入标题" Text="" ControlToValidate="titleTxtBox" Display="none"
                                SetFocusOnError="true" ValidationGroup="vg"></asp:RequiredFieldValidator></td>
                        <td><span style="color: Red">*</span></td>
                    </tr>
                    <tr class="row1">
                        <td style="width: 15%"><b>研究领域:</b></td>
                        <td style="width: 25%">
                            <asp:DropDownList ID="studyAreaDDL" runat="server" Width="98%" Height="20px"
                                ItemType="OUSMS.AppLogic.DataAccessLayer.StudyAreas" DataTextField="Name" DataValueField="ID">
                            </asp:DropDownList>
                        </td>
                        <td style="width: 10%"><span style="color: Red">*</span></td>
                        <td style="width: 15%"><b>提案类型:</b></td>
                        <td style="width: 25%">
                            <asp:DropDownList ID="motionTypeDDL" runat="server" Height="20px" Width="98%">
                                <asp:ListItem>远程教育研究</asp:ListItem>
                                <asp:ListItem>学科研究</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td style="width: 10%"><span style="color: Red">*</span></td>
                    </tr>
                    <tr class="row2">
                        <td><b>关键词</b></td>
                        <td colspan="4">
                            <asp:TextBox ID="keywordsTxtBox" runat="server" Width="100%" Height="20px"></asp:TextBox><asp:RequiredFieldValidator ID="keywordsRequiredFieldValidator"
                                runat="server" ErrorMessage="必须填写关键词" Text="" ControlToValidate="keywordsTxtBox" Display="none"
                                SetFocusOnError="true" ValidationGroup="vg"></asp:RequiredFieldValidator></td>
                        <td><span style="color: Red">*</span></td>
                    </tr>
                </table>
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
        <ajaxToolkit:TabPanel runat="server" ID="backgroundTab" HeaderText="研究背景和选题意义" ForeColor="Black">
            <ContentTemplate>
                <asp:TextBox ID="backgroundTxtBox" runat="server" Width="100%" TextMode="MultiLine" Height="600px"></asp:TextBox>
                 <ajaxToolkit:HtmlEditorExtender ID="htmlEditorExtender3" TargetControlID="backgroundTxtBox" EnableSanitization="false"
                    runat="server" DisplaySourceTab="True" OnImageUploadComplete="ajaxFileUpload_OnUploadComplete">
                    <Toolbar>
                        <ajaxToolkit:Bold />
                        <ajaxToolkit:Italic />
                        <ajaxToolkit:Underline />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:JustifyLeft />
                        <ajaxToolkit:JustifyCenter />
                        <ajaxToolkit:JustifyRight />
                        <ajaxToolkit:JustifyFull />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:InsertOrderedList />
                        <ajaxToolkit:InsertUnorderedList />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:CreateLink />
                        <ajaxToolkit:UnLink />
                        <ajaxToolkit:InsertImage />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:FontNameSelector />
                        <ajaxToolkit:FontSizeSelector />
                        <ajaxToolkit:ForeColorSelector />
                    </Toolbar>
                </ajaxToolkit:HtmlEditorExtender>
                <asp:RequiredFieldValidator ID="abstractRequiredFieldValidator"
                    runat="server" ErrorMessage="请填写研究背景和选题意义" Text="" ControlToValidate="backgroundTxtBox" Display="none"
                    SetFocusOnError="true" ValidationGroup="vg"></asp:RequiredFieldValidator>
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
        <ajaxToolkit:TabPanel runat="server" ID="planTab" HeaderText="研究思路" ForeColor="Black">
            <ContentTemplate>
                <asp:TextBox runat="server" ID="contentEditor" TextMode="MultiLine" Height="600px"
                    Width="100%" Text="" />
                <ajaxToolkit:HtmlEditorExtender ID="htmlEditorExtender2" TargetControlID="contentEditor" EnableSanitization="false"
                    runat="server" DisplaySourceTab="True" OnImageUploadComplete="ajaxFileUpload_OnUploadComplete">
                    <Toolbar>
                        <ajaxToolkit:Bold />
                        <ajaxToolkit:Italic />
                        <ajaxToolkit:Underline />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:JustifyLeft />
                        <ajaxToolkit:JustifyCenter />
                        <ajaxToolkit:JustifyRight />
                        <ajaxToolkit:JustifyFull />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:InsertOrderedList />
                        <ajaxToolkit:InsertUnorderedList />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:CreateLink />
                        <ajaxToolkit:UnLink />
                        <ajaxToolkit:InsertImage />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:FontNameSelector />
                        <ajaxToolkit:FontSizeSelector />
                        <ajaxToolkit:ForeColorSelector />
                    </Toolbar>
                </ajaxToolkit:HtmlEditorExtender>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="请填写提案内容;"
                    ControlToValidate="contentEditor" Display="None" ValidationGroup="vg"></asp:RequiredFieldValidator>
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
        <ajaxToolkit:TabPanel runat="server" ID="targetTab" HeaderText="预期目标" ForeColor="Black">
            <ContentTemplate>
                <asp:TextBox ID="targetTxtBox" runat="server" Width="100%" TextMode="MultiLine" Height="600px"></asp:TextBox>
                <ajaxToolkit:HtmlEditorExtender ID="htmlEditorExtender1" TargetControlID="targetTxtBox" EnableSanitization="false"
                    runat="server" DisplaySourceTab="True" OnImageUploadComplete="ajaxFileUpload_OnUploadComplete">
                    <Toolbar>
                        <ajaxToolkit:Bold />
                        <ajaxToolkit:Italic />
                        <ajaxToolkit:Underline />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:JustifyLeft />
                        <ajaxToolkit:JustifyCenter />
                        <ajaxToolkit:JustifyRight />
                        <ajaxToolkit:JustifyFull />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:InsertOrderedList />
                        <ajaxToolkit:InsertUnorderedList />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:CreateLink />
                        <ajaxToolkit:UnLink />
                        <ajaxToolkit:InsertImage />
                        <ajaxToolkit:HorizontalSeparator />
                        <ajaxToolkit:FontNameSelector />
                        <ajaxToolkit:FontSizeSelector />
                        <ajaxToolkit:ForeColorSelector />
                    </Toolbar>
                </ajaxToolkit:HtmlEditorExtender>
                
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
                    runat="server" ErrorMessage="请填写预期目标" Text="" ControlToValidate="targetTxtBox" Display="none"
                    SetFocusOnError="true" ValidationGroup="vg"></asp:RequiredFieldValidator>
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
        <ajaxToolkit:TabPanel runat="server" ID="attachmentTab" HeaderText="附件">
            <ContentTemplate>
                <table border="0" cellspacing="1" cellpadding="2" style="width: 100%">
                    <tr class="row1">
                        <td align="left" colspan="4">
                            <asp:FileUpload ID="FileUpload" runat="server" Width="400px" Height="25px" />
                        </td>
                        <td colspan="2">
                            <asp:Button ID="uploadButton" runat="server" Text="上传" Width="80px" Height="25px"
                                OnClick="uploadButton_Click" />
                        </td>
                    </tr>
                    <tr class="row2">
                        <td colspan="6">
                            <asp:GridView ID="filesGridView" runat="server" Width="100%"
                                AutoGenerateColumns="False" ItemType="OUSMS.AppLogic.DataAccessLayer.MotionFiles"
                                OnRowDataBound="filesGridView_RowDataBound" GridLines="Vertical" BorderStyle="None" EmptyDataText="未添加附件" ShowHeaderWhenEmpty="true"
                                Style="width: 100%; color: #686868; font-size: 14px; font-family: 宋体; background-color: #bed0e2; vertical-align: middle; border-collapse: collapse">
                                <Columns>
                                    <asp:TemplateField HeaderText="序号">
                                        <ItemTemplate>
                                            <asp:Label ID="indexLbl" runat="server"></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle"
                                            Wrap="false" Width="40px" />
                                        <ItemStyle HorizontalAlign="Center" Font-Bold="true" VerticalAlign="Middle" Width="40px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="文件名">
                                        <ItemTemplate>
                                            <asp:Label ID="fileNameLbl" runat="server" Text='<%#Item.FileName %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle"
                                            Wrap="false" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="上传时间">
                                        <ItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%#Item.UploadDateTime.ToString("yyyy/MM/dd HH:mm") %>' Width="100%"></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" Width="120px"
                                            Wrap="false" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" Wrap="false" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="下载">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="downloadLnkBtn" runat="server" NavigateUrl='<%# "DownloadFile.aspx?MID="+ Item.ID %>' Font-Underline="true"
                                                Target="_blank">下载</asp:HyperLink>
                                        </ItemTemplate>
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" Width="60px"
                                            Wrap="false" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="60px" Wrap="false" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="删除">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="deleteLinkButton" runat="server" OnClick="deleteLinkButton_Click" Font-Underline="true"
                                                CommandArgument='<%#Item.ID %>' OnClientClick="javascript:return confirm('您确定要删除此文件吗？')">删除</asp:LinkButton>
                                        </ItemTemplate>
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" Width="60px"
                                            Wrap="false" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="60px" Wrap="false" />
                                    </asp:TemplateField>
                                </Columns>
                                <HeaderStyle CssClass="row2" />
                                <PagerStyle CssClass="rowend" HorizontalAlign="Center" />
                                <RowStyle CssClass="row1" />
                                <AlternatingRowStyle CssClass="row2" />
                                <EmptyDataRowStyle CssClass="row1" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
        <ajaxToolkit:TabPanel runat="server" ID="RelatedDepartmentsTabPanel" HeaderText="相关部门" ForeColor="Black">
            <ContentTemplate>
                请勾选该提案所涉及到的相关部门
                <asp:CheckBoxList ID="departmentChkboxList" runat="server" DataTextField="Name" DataValueField="ID" RepeatColumns="4" 
                    RepeatDirection="Horizontal" Width="100%">
                    
                </asp:CheckBoxList>
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
    </ajaxToolkit:TabContainer>   
    <table border="0" cellspacing="1" cellpadding="2" style="width:100%">        
        <tr class="row2" align="center">
            <td>
                <asp:Button ID="saveBtn" runat="server" BackColor="Gray" Text="保  存" Width="80px" Height="25px" CausesValidation="true" OnClick="saveBtn_Click" ValidationGroup="vg" />
                &nbsp;&nbsp;
                            <asp:Button ID="submitBtn" runat="server" BackColor="Gray" Text="提  交" Width="80px" Height="25px" CausesValidation="true" OnClick="submitBtn_Click" ValidationGroup="vg" />
            </td>
        </tr>
        <tr class="row1">
            <td style="color: Red; padding-bottom: 5px">
                <asp:ValidationSummary ID="ValidationSummary" runat="server" BorderStyle="Solid"
                    BorderColor="Red" DisplayMode="BulletList" HeaderText="信息提交失败，请按下述提示进行修改:"
                    BorderWidth="1px" ShowSummary="true" CssClass="validationsummary" ValidationGroup="vg" />
                <asp:Label ID="errorMsgLbl" runat="server" Visible="false" ForeColor="Red" BorderColor="Red"
                    BorderWidth="1px" BorderStyle="Solid" Width="100%" CssClass="validationsummary"></asp:Label></td>
        </tr>        
    </table>
    <asp:HiddenField ID="motionIDHF" runat="server" />
</asp:Content>
